import request from '@/utils/request.js';

/**
 * 创建病虫草害监测记录
 * @param {Object} data 病虫草害记录数据
 * @returns {Promise}
 */
export function createPestDiseaseRecord(data) {
  return request.post('/app-api/nongye/appPest-weed-disease/create', data);
}

/**
 * 更新病虫草害监测记录
 * @param {Object} data 病虫草害记录数据
 * @returns {Promise}
 */
export function updatePestDiseaseRecord(data) {
  return request.put('/app-api/nongye/appPest-weed-disease/update', data);
}

/**
 * 获取病虫草害监测记录详情
 * @param {Number} id 记录ID
 * @returns {Promise}
 */
export function getPestDiseaseDetail(id) {
  return request.get('/app-api/nongye/appPest-weed-disease/get', { id });
}

/**
 * 删除病虫草害监测记录
 * @param {Number} id 记录ID
 * @returns {Promise}
 */
export function deletePestDiseaseRecord(id) {
  return request.delete(`/app-api/nongye/appPest-weed-disease/delete?id=${id}`);
}

/**
 * 获取病虫草害监测记录分页列表
 * @param {Object} params 查询参数
 * @returns {Promise}
 */
export function getPestDiseasePage(params) {
  return request.get('/app-api/nongye/appPest-weed-disease/page', params);
}

/**
 * 批量删除病虫草害监测记录
 * @param {Array} ids 记录ID数组
 * @returns {Promise}
 */
export function deletePestDiseaseRecords(ids) {
  return request.delete('/app-api/nongye/appPest-weed-disease/delete-list', { ids });
} 